package com.finesys.backend.common.model.user;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.apache.ibatis.type.Alias;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>Title: 用户信息</p>
 * <p>Description: </p>
 * <p>Copyright: CopyRight (c) 2020-2035</p>
 * <p>Company: finesys Co. LTD.</p>
 * <p>Author: lehoon</p>
 * <p>Date: 2020-10-20</p>
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Alias("user")
public class UserModel implements Serializable {
	private static final long serialVersionUID = 4738653406569508361L;
	@ApiModelProperty("用户id")
	@Length(max = 64, message = "id不能超过64字符")
	private String id;
	@ApiModelProperty("用户登录名")
	@NotBlank(message = "用户登录名不能为空")
	@Length(max = 32, message = "用户登录名不能超过32字符")
	private String username;
	@ApiModelProperty("用户密码")
	@Length(max = 64, message = "用户密码不能超过64字符")
	private String password;
	@ApiModelProperty("用户昵称")
	@NotBlank(message = "用户昵称不能为空")
	@Length(max = 32, message = "用户昵称不能超过32字符")
	private String name;
	@ApiModelProperty("用户状态  0：禁用， 1 启用")
	@Range(min = 0, max = 1, message = "状态只能选择0或1")
	private String status;
	@ApiModelProperty("用户创建时间")
	private Date createtime;
	@ApiModelProperty("用户联系方式")
	private String phone;
	@ApiModelProperty("用户角色")
	private List<String> roles;
	@ApiModelProperty("用户介绍")
	private String introduction;
	@ApiModelProperty("角色名称, buisness业务人员, admin管理员")
	private String rolename;
	@ApiModelProperty("客户端ip地址")
	private String remoteAddress;
}
